package com.joysuch.wwyt.workflow.repository;

import com.joysuch.wwyt.workflow.entity.WorkFlowDoc;
import com.joysuch.wwyt.workflow.entity.WorkFlowMenu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import javax.persistence.Tuple;
import java.util.List;

public interface WorkFlowDocDao extends JpaRepository<WorkFlowDoc, Long>{

    WorkFlowDoc findByDocCode(String docCode);

    WorkFlowDoc findByDocCodeAndIdIsNot(String docCode, Long id);

    @Query(value = "select d from  WorkFlowDoc d order by d.showOrder ")
    List<WorkFlowDoc> findAllOrderByShowOrder();

}
